<?php
/*
 * @Description: 
 * @Author: Leequik
 * @Date: 2025-03-19 17:47:05
 * @LastEditTime: 2025-08-21 23:03:35
 * @LastEditors: Leequik
 */

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\TestController;
use App\Http\Controllers\QueueTestController;
use App\Http\Controllers\RedisAppController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/welcome', function () {
    return view('welcome');
});
Route::get('/', function () {
    return view('index');
});
//http://www.catch.com/index.php/loop
Route::get('/loop', [App\Http\Controllers\applicationHookLimitController::class, 'loop']);




//redis队列测试
Route::get('/test', [TestController::class, 'index']);
Route::post('/test_redis_list', [TestController::class, 'redis_list']);
Route::get('/get_keys', [TestController::class, 'get_keys']);
Route::post('/delete_key', [TestController::class, 'delete_key']);


Route::get('/queue_test', [QueueTestController::class, 'queue_index']);
Route::get('/queue_keys', [QueueTestController::class, 'get_keys']);
Route::post('/delay_queue', [QueueTestController::class, 'delay_queue']); //发布延时队列任务
Route::post('/priority_queue', [QueueTestController::class, 'priority_queue']); //发布优先级队列任务

Route::post('/daley_queue_work', [QueueTestController::class, 'daley_queue_work']); //消费延时队列任务
Route::post('/priority_queue_work', [QueueTestController::class, 'priority_queue_work']); //消费优先级队列任务
Route::get('/stop_queue_work', [QueueTestController::class, 'stop_queue_work']); //队列任务消费终止

//set zset的应用
Route::get('/set_zset', [QueueTestController::class, 'set_zset']);
Route::post('/add_set', [QueueTestController::class, 'add_set']);
Route::get('/get_lucyKeys', [QueueTestController::class, 'get_lucyKeys']);
Route::get('/lucky_key', [QueueTestController::class, 'get_lucky']);
Route::post('/add_zset', [QueueTestController::class, 'add_zset']);
Route::get('/get_zset', [QueueTestController::class, 'get_zset']);

//redis发布订阅
Route::get('/pub_sub', [QueueTestController::class, 'pub_sub']);
Route::get('/get_sub_user', [QueueTestController::class, 'get_sub_user']);
Route::post('/publish_msg', [QueueTestController::class, 'publish_msg']);
Route::post('/add_subscribe', [QueueTestController::class, 'add_subscribe']);
Route::post('/sub_user', [QueueTestController::class, 'sub_user']);

//redis与mysql交互
Route::get('/redis_mysql', [QueueTestController::class, 'redis_mysql']);
Route::post('/data_add', [QueueTestController::class, 'data_add']);
Route::post('/get_data_redismysql', [QueueTestController::class, 'getRedisMYsql']);

//redis幂等和一致性锁应用
Route::get('/idempotent_lock', [RedisAppController::class, 'idempotentLock']);
Route::post('/idempotent_add', [RedisAppController::class, 'idempotentLockApi']);
Route::post('/lua_lock', [RedisAppController::class, 'idempotentLockLua']);



Route::get('/data_fit', [RedisAppController::class, 'data_fit']);

Route::get('/seckill', [RedisAppController::class, 'seckill']);



/*
Route::get('/test', function () {
    return 'hello world!';
});
/*
//Route::view('/wel', 'welcome');
Route::view('/wel', 'welcome', ['name' => 'Taylor']);

Route::get('/hello', function () {
    return "hello world!";
});

*/





//vue页面请求的路由
/*
Route::get('{any}', function () {
    return view('index');
})->where('any', '.*');
*/